﻿@{
    Layout = null;
    var linchuangshijian = ViewBag.Linchuangshijian as ChestPainCenterSystem.Areas.ChestPainCenter.Models.linchuangshijian;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache" content="no-cache" />
    <title>诊疗记录详情</title>
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/ligerui-icons.css" />
    <link rel="stylesheet" href="~/Scripts/ligerUI/skins/Gray/css/all.css" />
    <link rel="stylesheet" href="~/Content/css/common.css" />
    <script src="~/Scripts/jquery-1.10.2.min.js"  ></script>
    <script src="~/Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
    <style>
        .gridtable {
            width: 400px;
            margin: 0px;
        }

            .gridtable td {
                height: 30px;
                line-height: 30px;
            }

        .radio_label {
            display: inline-block;
            width: auto;
            height: 22px;
            background: url(/Content/images/radiobutton.png) no-repeat;
            background-position: -13px -16px;
            text-indent: 22px;
            line-height: 22px;
        }

            .radio_label:hover {
                background-position: -13px -116px;
            }

        .checkbox_label {
            display: inline-block;
            width: auto;
            height: 22px;
            background: url(/Content/images/checkboxbutton.png) no-repeat;
            background-position: -13px -16px;
            text-indent: 22px;
            line-height: 22px;
        }

            .checkbox_label:hover {
                background-position: -13px -116px;
            }

        .checked {
            background-position: -13px -216px;
        }

            .checked:hover {
                background-position: -13px -216px;
            }

        input[type=radio] {
            width: 0;
        }

        input[type=checkbox] {
            width: 0;
        }

        .tabl  {
            width: 100%;
            border: solid 1px #f5eeee;
        }
        .tab1 tr td {
            border: solid 1px #f5eeee;
            text-align:center;
        }
        
    </style>
</head>
<body>
    <div style="margin:10px 0px;">
        <form id="form1">
            <table class="gridtable">
                <tr>
                    <td style="text-align:right; width:100px;">
                        临床事件名称：
                    </td>
                    <td>
                        <input type="text" id="txtName" name="txtName" class="l-text" style="width:250px;" value="@linchuangshijian.name" /><font style="color:red;">&nbsp;*</font>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right; width:100px;">
                        临床事件编号：
                    </td>
                    <td>
                        <input type="text" id="txtCode" name="txtCode" class="l-text" style="width:250px;" value="@linchuangshijian.code" /><font style="color:red;">&nbsp;*</font>
                    </td>
                </tr>

                <tr>
                    <td style="text-align:right; width:100px;">
                        绑定诊疗记录：
                    </td>
                    <td>
                        <table class="tab1" border="0" id="tabInfo">
                            <tr><td width="100px">诊疗编码</td><td width="100px">诊疗名称</td><td style="border:none;" width="100px" rowspan="3" valign="top"><input id="btnBind" type="button" value="添加记录" class="l-button" onclick="EditBind(0)" /></td></tr>
                           @{
                               if (!string.IsNullOrEmpty(linchuangshijian.zl_Ids)) { 
                               for (int i = 0; i < linchuangshijian.zl_Ids.Split(',').Length; i++)
			{
                                 
			 <tr><td>@linchuangshijian.zl_code.Split(',')[i]</td><td>@linchuangshijian.zl_Names.Split(',')[i]</td></tr>
			}
            }}
                        </table>

                    </td>
                </tr>

                <tr>
                    <td colspan="2" style="text-align:center;padding-top:10px;">
                        <input type="hidden" id="txtId" name="txtId" value="@linchuangshijian.Id" />
                        <input type="hidden" id="txtzljlId" name="txtzljlId" value="@linchuangshijian.zl_Ids" />
                        <input type="hidden" id="txtzljlName" name="txtzljlName" value="@linchuangshijian.zl_Names" />
                        <input type="hidden" id="txtzljlCode" name="txtzljlCode" value="@linchuangshijian.zl_code" />
                        <input id="btnSubmit" type="button" value="确定" class="l-button" onclick="save()" />&nbsp;&nbsp;&nbsp;
                        <input id="btnReset" type="reset" value="重置" class="l-button" />
                    </td>
                </tr>
                <tr></tr>
            </table>
        </form>
    </div>
    <script  >
       
        function save() {
            if ($("#txtName").val() == "")
            { $("#txtName").focus(); return; }
            if ($("#txtCode").val() == "")
            { $("#txtCode").focus(); return; }
            var arr = $("#form1").serializeArray();
            var obj = {};
            for (var i = 0; i < arr.length; i++) {
                obj[arr[i].name] = arr[i]['value']
            }
            var editurl = "/ChestPainCenter/DisRecord2/Save";
            $.post(editurl, obj, function (data, textStatus) {
                if (textStatus == "success") {
                    var d = $.parseJSON(data);
                    if (d.Result == 1) {
                        $.ligerDialog.success("保存成功", function () {
                            parent.window.btnSearch.click();
                            frameElement.dialog.close();
                        })
                    }
                    else if (d.Result == 0) {
                        $.ligerDialog.error(d.Body);
                    }
                    else {
                        $.ligerDialog.error("程序错误");
                    }
                } else { $.ligerDialog.error("程序错误"); }
            })
        }
        function EditBind(id) {
            $.ligerDialog.open({
                height: 300,
                width: 420,
                title: '更新绑定诊疗记录',
                data: { Id: id },
                url: ' /ChestPainCenter/DisRecord2/Bind?pathId=' + id,
                showMax: false,
                showToggle: false,
                showMin: false,
                isResize: false,
                slide: false,
                buttons: [{
                    text: '回调函数', onclick: function (i, d) {
                        $("#btnSearch").click();
                    }
                }],
                cls: "closeCls"
            });
            $(".l-dialog-buttons").hide();
        }
        $(function () {
            //追加样式
            $("input[type=radio]").parent().addClass("radio_label");
            if (navigator.userAgent.indexOf("Firefox") > 0) { $(":radio,:checkbox").hide(); }
            $("input[type=radio][disabled!=disabled]").click(function () {
                $("input[type=radio][name='" + $(this).attr('name') + "']").parent().removeClass("checked")
                $(this).parent().addClass("checked");
            });
            $("input[type=radio][checked=checked]").parent().addClass("checked");
            $("input[type=checkbox]").parent().addClass("checkbox_label");
            $("input[type=checkbox][disabled!=disabled]").click(function (e) {
                if ($(this).parent().hasClass("checked"))
                    $(this).parent().removeClass("checked");
                else
                    $(this).parent().addClass("checked");
            });
            $("input[type=checkbox][checked=checked]").parent().addClass("checked");
        })
    </script>
</body>
</html>